Repository navigation
feat(auth): add gog auth rekey to rotate the file keyring password - #1224
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesAdds Example: Rotate six stored credential entries with
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this PR supplies a useful capability absent from main. The earlier changelog finding is fixed and compatibility proof is sufficient; the remaining blocker is owner agreement on the command and its concurrency contract. Priority: P2 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherThe auth CLI resolves the selected file keyring, decrypts its entries, writes them through the existing encrypted-file serializer, and reports a verified output directory for deliberate installation. flowchart TD
A[Auth rekey CLI] --> B[Backend and path checks]
B --> C[Read encrypted source entries]
C --> D[Decrypt with current password]
D --> E[Write separate encrypted output]
E --> F[Verify with new password]
F --> G[Report installation instructions]
Technical reviewBest possible solution: Ship an owner-approved output-only rotation workflow with an explicit concurrency contract and an agreed scope for the shared backend changes. Do we have a high-confidence way to reproduce the issue? This is a new capability rather than a bug report; current-main source confirms whole-keyring rotation is absent, and no target code was executed. Is this the best way to solve the issue? A separately verified encrypted copy protects the original credentials and preserves more than per-account export/import, while the concurrency and shared timeout choices need owner agreement. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d48a86fb3fba. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 17, 2026, 2:51 PM ET / 18:51 UTC (Revision 2). |
|
Is the prompt for clawsweeper available somewhere? I went through several
reviews with Claude (Opus) and Codex (Sol) until they were both happy with
it. Having the prompt you use available would save on the back and forth. :)
…On Sat, Oct 17, 2026 at 11:34 AM clawsweeper[bot] ***@***.***> wrote:
*clawsweeper[bot]* left a comment (openclaw/gogcli#1224)
<#1224 (comment)>
Codex review: needs real behavior proof before merge.
What this changes
Adds an auth command that writes and verifies a separately encrypted copy
of the file keyring using a new password.
*Example:* Rotate a seven-entry file keyring with gog auth rekey
/tmp/new-keyring.
- *Before:* There is no whole-keyring password rotation command.
- *After:* A verified seven-entry copy uses the new password, while
the original remains available for deliberate installation and rollback.
Review scores
Measure Result What it means
*Overall readiness* 🦐 gold shrimp *(3/6)* Substantial implementation and
real CLI evidence support the feature, with no definite P0–P2 defect found;
owner direction and stable-release compatibility remain unresolved.
*Proof confidence* 🦐 gold shrimp *(3/6)* Real behavior proof is
necessary before merge. See Before merge
<#m_1698964771206165896_before-merge>.
*Patch quality* 🐚 platinum hermit *(4/6)* 1 actionable review finding
remain. Product
*Kind:* Feature · *Worth it:* Needs a maintainer decision · *Fix scope:*
Complete
*User problem:* File-keyring users cannot rotate the encryption password
for all stored credentials through a supported CLI command.
*Reason:* The workflow has clear practical value, but introduces a
command, flag, environment variable, and concurrency semantics without
recorded owner direction.
Merge readiness
⛔ *Blocked before merge - 4 items remain*
This PR adds a useful capability absent from main, but needs an owner
decision on the command and its unlocked-copy semantics.
*Priority:* P2
*Reviewed head:* 515fa21
*Owner decision:* Required. See Decision needed
<#m_1698964771206165896_decision-needed>.
Decision needed
- *Question:* Should this PR introduce output-only password rotation
with --skip-unreadable and GOG_KEYRING_NEW_PASSWORD, including unlocked
source reads and the shared file-backend changes?
- *Recommendation:* *Approve the proposed command:* Accept the
documented snapshot limitation and shared backend adjustments, subject to
compatibility proof and the changelog correction.
- *Why:* No owner approval appears in this PR's discussion, and
unlocked reads depart from the existing serialized-access design.
Before merge
- *Add real behavior proof* - The supplied terminal transcript
exercises the real CLI against existing credentials, verifies installation
and rollback readability, rejects the old password on the new copy, and
completes Google calls; the source release is unspecified, leaving the
required v0.45.0 upgrade case unestablished. After adding proof, update the
PR body, then request a new review with @clawsweeper re-review. The PR
author or someone with repository write access can request it.
- *Add the required changelog reference and contributor credit (P3)* -
The new Unreleased entry omits both the PR reference and contributor thanks
required by the root AGENTS.md; add the reference and credit
@sorenisanerd <https://github.com/sorenisanerd> to this entry.
- *Resolve maintainer decision* - Resolve the maintainer decision
shown above before merge.
- *Add data-model compatibility proof* - The review found that
existing stored data may not work after upgrade. Show that existing data
still loads and works with this change.
Findings
- [P3] Add the required changelog reference and contributor credit —
CHANGELOG.md:5
Tests
- Missing end-to-end proof: Show rotation, installation, and rollback
from a v0.45.0-created keyring with accounts, scopes, defaults, and
non-token secrets preserved.
*Agent review details* How this fits together
The auth CLI resolves the selected file-keyring directory, decrypts
existing credential entries, and writes them through the existing keyring
serializer into a separate directory.
flowchart TD
A[Auth rekey CLI] --> B[Backend and path checks]
B --> C[Read live encrypted entries]
C --> D[Decrypt with current password]
D --> E[Write separate encrypted output]
E --> F[Verify with new password]
F --> G[Report installation instructions]
Loading Technical review
Best possible solution:
Ship an owner-approved output-only rotation command with stable-release
compatibility proof and clear snapshot and installation guidance.
Do we have a high-confidence way to reproduce the issue?
This is a new capability rather than a reported bug; source inspection
confirms main lacks whole-keyring rotation, and no target code was executed.
Is this the best way to solve the issue?
A separately verified copy protects the live credentials well, and
existing per-account export/import does not preserve the entire keyring;
its supported concurrency contract needs owner agreement.
Full review comments:
- [P3] Add the required changelog reference and contributor credit —
CHANGELOG.md:5
The new Unreleased entry omits both the PR reference and contributor
thanks required by the root AGENTS.md; add the reference and credit
@sorenisanerd <https://github.com/sorenisanerd> to this entry.
Confidence: 1
Overall correctness: patch is correct
Overall confidence: 0.88
AGENTS.md: found and applied where relevant.
Codex review notes: model internal, reasoning medium; reviewed against
d48a86f
<d48a86f>
.
Provenance checked
- File-keyring encoding and enumeration keeps the original intent (
8135cc3
<8135cc3>:
Make key names safe on Windows while retaining legacy reads.)
- File-keyring read serialization changes intended behavior with a
stated reason (f3d5753
<f3d5753>:
Serialize credential access to avoid concurrent partial reads and writes;
rekey explicitly bypasses the normal opener to avoid creating or modifying
live bookkeeping.)
- Backend operation timeout changes intended behavior with a stated
reason (6430dd1
<6430dd1>:
Bound unresponsive keyring operations; the patch excludes actual file
backends because detached timeout workers can outlive their store lock.)
Testing
Proof path: shipped entry point.
Security
None.
Evidence
What I checked:
- *Current main lacks whole-keyring rotation:* Main's AuthCmd exposes
keyring configuration and per-account token export/import, but no rekey
command; token export does not copy arbitrary keyring secrets. (
internal/cmd/auth.go:110
<https://github.com/openclaw/gogcli/blob/d48a86fb3fba9aa939fc6b4a0e9f75156add9f98/internal/cmd/auth.go#L110>,
d48a86f
<d48a86f>
)
- *Verified PR introduction:* The pinned diff adds output-only
re-encryption, independent read-back verification, overlap checks, force
replacement, CLI integration, tests, and documentation. (
internal/secrets/rekey.go:76
<https://github.com/openclaw/gogcli/blob/515fa2141007dcbb30d7781aa3c0290e4d22c52e/internal/secrets/rekey.go#L76>,
515fa21
<515fa21>
)
- *Substantial live CLI evidence:* The full PR body supplies a
relocated real-keyring transcript covering seven-entry rotation,
installation, old-password rejection, retained-copy readability, successful
Google calls, overlap rejection, and force replacement. It does not
identify the source installation as v0.45.0. Captured body source identity:
d82880c526a6806439266cb3ca7be25a36300334ddaaf95397130a70490d1782. (
515fa21
<515fa21>
)
- *Existing serialization decision:* In #597
<#597>, steipete approved
serialized file-keyring access and documented the landed
concurrent-reader/writer proof. This PR deliberately bypasses that lock for
rekey reads and documents a non-atomic snapshot. (
internal/secrets/rekey.go:196
<https://github.com/openclaw/gogcli/blob/515fa2141007dcbb30d7781aa3c0290e4d22c52e/internal/secrets/rekey.go#L196>,
515fa21
<515fa21>
)
- *Feature ownership and timeout provenance:* History identifies Peter
Steinberger's keyring serialization, Windows-safe encoding, and
backend-policy refactors; Malo Bourgon contributed configurable timeout
behavior in #845 <#845>. The
new file-backend timeout exclusion explains that timed-out goroutines could
otherwise continue after releasing the store lock. (
internal/secrets/backend.go:333
<https://github.com/openclaw/gogcli/blob/d48a86fb3fba9aa939fc6b4a0e9f75156add9f98/internal/secrets/backend.go#L333>,
d48a86f
<d48a86f>
)
- *Imported persistence contract:* The patch imports this dependency
and directly decodes its persisted format. Version v1.2.2 stores JSON
keyring items in JOSE-encrypted files, percent-decodes filenames during
enumeration, and writes through os.WriteFile; the new reader matches those
operations. (file.go:76
<https://github.com/99designs/keyring/blob/929f178361c0be06c50f0a82598cbfa1a965f40f/file.go#L76>,
929f178361c0
<99designs/keyring@929f178>
)
Likely related people:
- *Malo Bourgon:* Raw commit b3c2856
<b3c2856>
adds internal/secrets/backend.go:185 relative to its recorded parents. This
identifies author metadata, not feature responsibility or a PR merger.
(role: source-line author; confidence: medium; commits: b3c2856
<b3c2856>;
files: internal/secrets/backend.go)
Review metrics
Metric Value Why it matters
*Patch composition* Production +694/-5; tests +1473; documentation +119/-2 Most
growth covers credential-copy safety, verification, path handling, and
failure scenarios for the new command. Labels
Label changes:
- add P2: Useful credential-maintenance functionality with limited
immediate user impact; no urgent regression is established.
- add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp;
proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
- add status: 📣 needs proof: The PR needs real behavior proof before
ClawSweeper can clear the contributor ask.
Label justifications:
- P2: Useful credential-maintenance functionality with limited
immediate user impact; no urgent regression is established.
- rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof
is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
- status: 📣 needs proof: The PR needs real behavior proof before
ClawSweeper can clear the contributor ask.
Rank-up moves
Optional improvements that raise the rating; they are not merge blockers.
- Provide the stable-release credential-preservation scenario
described in the proof assessment.
Rating scale
6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit ·
3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab.
Overall follows the weaker of proof and patch quality; ✨ marks media proof
(a screenshot, video, or linked artifact) that directly shows the changed
behavior.
Workflow
ClawSweeper edits this one comment on every review. Comment @clawsweeper
re-review for a fresh review only. Repair and merge execution lanes are
retired.
*Reviewed October 17, 2026, 2:33 PM ET / 18:33 UTC.*
—
Reply to this email directly, view it on GitHub
<#1224?email_source=notifications&email_token=AABHCWRMMCJCNMQW3QWHHVL5UO3TVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMMRTHA3DKNJYHE3KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-6238655896>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABHCWQSMM6UQ7KEEYCY5TL5UO3TVAVCNFSNUABGKJSXA33TNF2G64TZHMYTCMJVGE3DCNZQGM5US43TOVSTWNJZGAYTKOBUGE3TFILWAI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
515fa21 to
0d18ccb
Compare
|
@clawsweeper re-review Addressed the changelog finding and both proof items at
|
|
🦞👀 Re-review progress:
|
|
The motivation, which I now realize I should have put front and center, was an accidental leak of my keyring password to an LLM, prompting (no pun intended) me to rotate said key. I could not find any existing tool to do this. |
Add `gog auth rekey <outdir>`, which reads the file keyring with the current password, re-encrypts every entry under a new password, and writes a verified copy to the separate output directory. The live keyring is opened read-only and left byte-identical, so no crash or bug in output writing can lose or corrupt live credentials. The output directory is a required positional argument, is created with the keyring directory's permissions, and is refused when it is the keyring directory, lies inside it, contains it, or is reached through a symlink or case alias. A non-empty output is refused unless --force is passed, which replaces those entries and reports exactly which were removed; a failed replacement reports the removals that completed and names the entry that may have been partially removed. Before reporting success the command reopens the output with the new password and reads every entry back, comparing data and metadata. It prints paths, counts and key names only, never payloads or passwords, and prints the exact installation command that retains the old directory until the new keyring is proven. --skip-unreadable omits entries that cannot be decrypted and reports their keys; an empty keyring reports that no password was changed. Regenerate the command reference and document output-directory rotation in Paths and State and the installation guide. Validation: make ci gates (fmt-check, lint, deadcode, docs-check), the full internal/secrets and internal/cmd suites, -race, and linux/darwin/windows builds and test binaries. Every safety behaviour has a test that fails when the behaviour is removed, confirmed by mutation testing.
0d18ccb to
6ea0eb3
Compare
|
Thanks @sorenisanerd — landed in e06131d. The maintainer follow-up holds the source store lock throughout rekey, stages and independently verifies the complete output, fsyncs before atomic directory exchange on Linux/macOS, and rolls back publication failures. Existing output is refused on platforms without atomic exchange; Windows supports a fresh output path. Legacy formats and metadata are preserved, and the live credential files remain unchanged. Validation: full |
Adds
gog auth rekey <outdir>to rotate the file-keyring password by writing a separately verified encrypted copy. The command never installs that copy or changes live credential files; it prints installation instructions that retain the old keyring. Passwords come from environment variables or a no-echo terminal prompt, never argv or output.The maintainer review found and fixed two data-safety defects before landing: source reads bypassed the store lock, and
--forceremoved existing output before the replacement was written and verified. Rekey now holds the shared store lock through publication, stages the complete replacement beside the destination, independently verifies data and metadata, flushes ciphertext and directory metadata, and atomically exchanges directories on Linux/macOS. Publication sync failures roll back; a second failure preserves and identifies recovery paths. Decrypted byte buffers are cleared where practical, and legacy and encoded keyring formats remain readable.Windows and filesystems without atomic directory exchange require a fresh output path; existing output is refused unchanged. Windows flushes ciphertext and publishes with a write-through rename. The normal
.lockbookkeeping file may be created. Stop other gog processes before manually installing the snapshot, since credentials can change after rekey releases the lock.Peter explicitly accepted this PR for landing on 2026-10-20. The secrets implementation received an in-session review and was excluded from external review under Peter's exception for this PR only. The CLI/documentation changes passed isolated Codex review at P0–P2. Original implementation and extensive compatibility coverage by @sorenisanerd; the Unreleased changelog thanks the contributor.
Validation: full
make cipassed on an isolated Linux runner; focused rekey/CLI tests and secrets race tests passed.govulncheck ./...found no reachable vulnerability; GO-2026-5932 affects the unimported OpenPGP package only. All exact-head GitHub CI checks passed: run 39474735303.